package main

import "fmt"

// 定义结构体  U大写就是公开的 u小写就是私有的
type User struct {
	name string
	age  int
	sex  string
}

func main() {
	var user1 User
	user1.name = "小王"
	user1.age = 18
	user1.sex = "男"
	fmt.Println(user1.name)

	user2 := User{}
	user2.name = "小红"
	fmt.Println(user2.name)

	user3 := User{
		name: "小兰",
		age:  18,
	}
	fmt.Println(user3.name)

	user4 := User{"小绿", 18, "女"}
	fmt.Println(user4.name)
}
